﻿using System.ComponentModel;
using System.Windows.Media;

namespace ImageProcessor.Shared
{
    public class MainViewModel : INotifyPropertyChanged
    {
        private ImageSource _sourceImage;

        public ImageSource SourceImage
        {
            get { return _sourceImage; }
            set
            {
                if(_sourceImage == value)
                    return;
                _sourceImage = value;
                OnPropertyChanged("SourceImage");
            }
        }

        public event PropertyChangedEventHandler PropertyChanged;

        protected virtual void OnPropertyChanged(string propertyName)
        {
            PropertyChangedEventHandler handler = PropertyChanged;
            if (handler != null) handler(this, new PropertyChangedEventArgs(propertyName));
        }
    }
}